package be.novelfaces.showcase.webdriver.util;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.ui.ExpectedCondition;
import org.openqa.selenium.support.ui.Wait;
import org.openqa.selenium.support.ui.WebDriverWait;

import be.novelfaces.webdriver.WebDriverManager;

public abstract class Waiter {
	
	public Waiter(){
		Wait<WebDriver> wait = new WebDriverWait(
				WebDriverManager.getWebdriver(), 15);
		wait.until(new ExpectedCondition<Boolean>() {
			public Boolean apply(WebDriver driver) {
				return waitForCondition(driver);
			}
		});
		
	}
	
	public abstract Boolean waitForCondition(WebDriver driver);

}
